package com.controller;

import com.controller.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
public class Controller {
    @RequestMapping("wx/get")
    public String wxGet(){
        Subject subject = SecurityUtils.getSubject();
        User principal = (User)subject.getPrincipal();
        log.info("wx:{}",principal);
        return "wx";
    }
    @RequestMapping("web/hello")
    public String hello(){
        Subject subject = SecurityUtils.getSubject();
        String principal = String.valueOf(subject.getPrincipal());
        log.info("web:{}",principal);
        return "hcj";
    }
}
